Hello,
Thanks for your response.
Have you tested this? As I'm fairly sure that's what Numbers is doing.
NSMetadataQueryUpdateRemovedItemsKey and NSMetadataQueryDidUpdateNotification which are iCloud Document API, have the following two limitations. Therefore, I believe Numbers uses other methods as well.
On iOS, NSMetadataQuery cannot handle files stored in local storage.
File changes can only be detected while the app is running.
Also, and I should have mentioned this in my previous reply, make sure you're using file coordination for all of this.
We found that it is possible to detect deletion of files in local storage while the app is running by using the NSFilePresenter API.
However, these APIs unable to detect whether a file was deleted while the app was not running.
If there is a better way than checking whether the URL contains “.Trash” to determine whether a file was deleted while the app was not running—like the method used by Numbers.app—we would like to adopt it in our app as well.
That said, as you mentioned, considering real user behavior, detecting whether the URL contains “.Trash” should be sufficient.
If the approach used by Numbers.app relies on Apple private APIs, we understand that it would not be available to third-party developers, and in that case, we will proceed with the “.Trash” URL check approach.
Topic:
App & System Services
SubTopic:
General
Tags: